
c
c
c
c     =====================================================
       subroutine qinit(maxmx,maxmy,meqn,mbc,mx,my,xlower,ylower,
     &                   dx,dy,q,maux,aux)
c     =====================================================
c
c     # Set initial conditions for q.
c     # Acoustics with smooth radially symmetric profile to test accuracy
c
       implicit double precision (a-h,o-z)
       dimension q(1-mbc:maxmx+mbc, 1-mbc:maxmy+mbc, meqn)
c
       pi = 4.d0*datan(1.d0)
       width = 0.1d0
       widthG = 0.01d0

       do 20 i=1,mx
          xcell = xlower + (i-0.5d0)*dx
          do 20 j=1,my
            ycell = ylower + (j-0.5d0)*dy            
			y = 1.d0/2.d0*dsqrt( 1.d0/4.d0/ycell**2 + 4.d0*xcell + 2.d0)
			y = y - 1.d0/4.d0/ycell 
			x = y**2
			r = dsqrt( (x-xcell)**2 + (y-ycell)**2 )
			pressure = 0.d0
			ux = 0.d0
			uy = 0.d0
             if (ycell .ge. y) then
				if (xcell .le. x) then
c                	pressure = 1.d0 + dcos(pi*r/width)
c                   pressure = dexp(-1.d0 * r**2 / widthG)
                    pressure = 1.d0
					ux = pressure/2.d0*1.d0/dsqrt(1.d0+4*ycell**2)			
					uy = pressure/2.d0*(-2.d0)*ycell/dsqrt(1.d0+4*ycell**2)		
				endif
             endif
             q(i,j,1) = pressure
             q(i,j,2) = ux
             q(i,j,3) = uy
c             
  20         continue
       return
       end
